﻿<div ng-controller="enterpriseUserController">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default"
                           data-click="panel-expand"><i class="fa fa-expand"></i></a>
                    </div>
                    <h4 class="panel-title">注册客户查询服务</h4>
                </div>
                <div class="panel-body">
                    <div class="form-inline filter-option">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="pull-right">
                                    <input class="form-control" type="text" ng-model="filter.enterprise_name" placeholder="请输入机构名称">
                                    <input class="form-control" type="text" ng-model="filter.phone_number" placeholder="请输入客户手机号(严格匹配)">
                                    <select class="form-control" ng-model="filter.isVerified">
                                        <option value="">请选择用户状态</option>
                                        <option value="0">已注册</option>
                                        <option value="1">已完善个人信息</option>
                                        <option value="2">企业等待审核中</option>
                                        <option value="3">已认证企业，等待银行账户审核</option>
                                        <option value="4">已绑定非兴业</option>
                                        <option value="5">已绑定兴业</option>
                                        <option value="-1">审核失败</option>
                                    </select>
                                    <button class="btn btn-sm btn-info" ng-click="reflash()"><i class="fa fa-search"></i> 筛选</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <table id="data-table" ng-table="tableParams" template-pagination="template/pagination.html"
                           class="table table-striped table-bordered table-hover table-condensed">
                        <tr ng-repeat="item in $data">
                            <td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>
                            <td data-title="'联系人'" class="text-center">{{ item.customer_name }}</td>
                            <td data-title="'用户等级'" class="text-center">{{ item.customer_level_id }}</td>
                            <td data-title="'联系电话'" class="text-center">{{ item.phone_number }}</td>
                            <td data-title="'用户状态'" class="text-center">{{ item.verify_status }}</td>
                            <td data-title="'机构名称'" class="text-center">{{ item.enterprise_name }}</td>
                            <td data-title="'所在地'" class="text-center">{{item.trade_location_province}}{{item.trade_location_city}}{{ item.trade_location }}</td>
                            <td class="text-center width-100 text-nowrap">
                                <button class="btn btn-info btn-xs" ng-click="setLevel(item)">
                                    <i class="fa fa-edit"></i> 设置等级
                                </button>
                                <button class="btn btn-info btn-xs" ng-click="show(item)">
                                    <i class="fa fa-edit"></i> 详细
                                </button>
                            </td>
                        </tr>
                    </table>
                </div>

                <div class="modal fade" id="modal-show">
                    <div class="modal-dialog" style="width:1100px">
                        <div class="modal-content">
                            <ng-form name="checkForm" novalidate>
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                        ×
                                    </button>
                                    <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>用户详情</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form-horizontal">

                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 联系人：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ item.customer_name }}
                                            </div>
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 用户状态：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.verify_status }}
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 联系电话：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.phone_number }}
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 机构名称：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.enterprise_name }}
                                            </div>
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 营业执照：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.credential_number }}
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 机构法人：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.agent_treasurer_name }}
                                            </div>
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 有效期：</label>
                                            <div class="col-md-4 form-control-static">
                                                {{  }}
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="control-label col-md-2"><span class="g-orange">*</span> 经营地址：</label>
                                            <div class="col-md-8 form-control-static">
                                                {{model.trade_location_province}}{{model.trade_location_city}}{{ model.trade_location }}
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <h4>企业操作员</h4>
                                            <hr />
                                            <table id="data-table" ng-table="tableParams1" template-pagination="template/pagination.html"
                                                   class="table table-striped table-bordered table-hover table-condensed">
                                                <tr ng-repeat="item in $data">
                                                    <td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>
                                                    <td data-title="'类型'" class="text-center">{{ item.member_name }}</td>
                                                    <td data-title="'用户名'" class="text-center">{{ item.customer_name }}</td>
                                                    <td data-title="'手机号'" class="text-center">{{ item.phone_number }}</td>
                                                    <td data-title="'绑定时间'" class="text-center">{{ item.bundling_time }}</td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div class="form-group width-full">
                                            <h4>出票账户</h4>
                                            <hr />
                                            <table id="data-table" ng-table="tableParams2" template-pagination="template/pagination.html" class="table table-striped table-hover table-condensed">
                                                <tr ng-repeat="item in $data.acct_list">
                                                    <td data-title="'账号'"width="10%" class="text-center">{{ item.account_number }}</td>
                                                    <td data-title="'银行名称'"width="10%" class="text-center">{{ item.account_person | limitTo: 12 }}{{ item.account_person.length > 12 ? '...' : '' }}</td>
                                                    <td data-title="'审核状态'" width="10%"class="text-center">{{ item.statusToDescription }}</td>
                                                    <td data-title="'描述'" width="10%"class="text-center"><div class="nowarp-hidden">{{ item.description }}</div></td>
                                                    <td ng-if="identity.is_operator == 0" class="text-center width-100 text-nowrap">
                                                        <button class="btn btn-success btn-xs" ng-click="read(item)" ng-disabled="item.is_verified==-2" ng-if="item.is_verified!= -1 || findEnterprise.is_alive != -1" style="border:1px solid #ebebeb;color:#333;background:#fff"><i class="fa fa-edit"></i> 详细</button>
                                                        <button class="btn btn-success btn-xs" ng-click="verify(item)" ng-if="identity.is_verified == 3 || findEnterprise.is_alive == 3"><i class="fa fa-edit"></i> 鉴权</button>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button class="btn btn-sm btn-white" data-dismiss="modal">
                                        <i class="fa fa-share-square-o"></i> 关闭
                                    </button>
                                </div>
                            </ng-form>
                        </div>
                    </div>
                </div>

                <div class="modal fade" id="modal-setLevel">
                    <div class="modal-dialog" style="width:1100px">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>设置客户等级</h4>
                            </div>
                            <div class="modal-body">
                                <div class="form-horizontal">
                                    <ng-form name="editForm" novalidate>
                                        <div class="form-group width-full">
                                            <label class="col-md-2 control-label">客户等级: </label>
                                            <div class="col-md-4 form-control-static">
                                                <!--{{ model.level }}-->
                                                <input type="text" class="form-control" ng-model="model.level" required>
                                            </div>
                                        </div>
                                    </ng-form>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-sm btn-success" ng-click="saveCustomerLevel()"
                                        ng-disabled="editForm.$invalid">
                                    <i class="fa fa-save"></i> 保存
                                </button>
                                <button type="button" class="btn btn-sm btn-white" data-dismiss="modal">
                                    <i class="fa fa-share-square-o"></i> 关闭
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
